package com.example.designpattenexample.memento.example;

public class Test {
    public static void main(String[] args) {
        VersionControlSystem vcs = new VersionControlSystem();

        Document document = new Document();
        document.setContent("content1");
        document.setOtherContent("otherContent1");
        System.out.println(document);
        vcs.add(document.backup());

        document.setContent("content2");
        document.setOtherContent("otherContent2");
        System.out.println(document);
        vcs.add(document.backup());

        document.setContent("content3");
        document.setOtherContent("otherContent3");
        System.out.println(document);
        vcs.add(document.backup());

        Backup version1 = vcs.getVersion(1);
        document.resume(version1);
        System.out.println(document);

        Backup lastVersion = vcs.getLastVersion();
        document.resume(lastVersion);
        System.out.println(document);

    }
}
